package com.d0325hw;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;

public class BirthTest {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        long time = new Date().getTime();
        System.out.println("请输入第一个人的出生日期");
        String birth1=sc.nextLine();
        Date d=sdf.parse(birth1);
        long time1 = d.getTime();
        long day = (time - time1) / 1000 / 3600 / 24;
        System.out.println("第一个人的生活的天数"+day);
        System.out.println("请输入第二个人的出生日期");
        String birth2=sc.nextLine();
        Date d2=sdf.parse(birth2);
        long time2=d2.getTime();
        long day2=(time-time2)/1000/3600/24;
        System.out.println("第二个人生活的天数"+day2);
        System.out.println("请输入第三个人的出生日期");
        String birth3=sc.nextLine();
        Date d3=sdf.parse(birth3);
        long time3=d3.getTime();
        long day3=(time-time3)/1000/3600/24;
        System.out.println("第三个人生活的天数"+day3);
        System.out.println("请输入第四个人的出生日期");
        String birth4=sc.nextLine();
        Date d4=sdf.parse(birth4);
        long time4=d4.getTime();
        long day4=(time-time4)/1000/3600/24;
        System.out.println("第四个人生活的天数"+day4);
        System.out.println("请输入第五个人的出生日期");
        String birth5=sc.nextLine();
        Date d5=sdf.parse(birth5);
        long time5=d5.getTime();
        long day5=(time-time5)/1000/3600/24;
        System.out.println("第五个人生活的天数"+day5);
        List<Long> myList=new ArrayList<>();
        myList.add(day);
        myList.add(day2);
        myList.add(day3);
        myList.add(day4);
        myList.add(day5);
        for (Long i:
             myList) {
            System.out.print(i+"\t");
        }

    }
}
